DistinctCount (fld), DistinctCount (fld, condFld), DistinctCount (fld, condFld, cond), DistinctCount (x)

Basic and Crystal syntax.

Arguments
Returns

Fractional Number

Action

Enables you to get a distinct count of the values that appear in your report. For example:

Examples

The following examples are applicable to both Basic and Crystal syntax:

DistinctCount({customer.REGION})

Counts the number of different States represented in the Region field, ignores any repetitions.

DistinctCount({customer.CITY}, {customer.REGION})

Calculates the number of different cities in each State group.

DistinctCount({orders.CUSTOMER ID}, {orders.ORDER DATE}, "weekly")

Counts the number of different customers contacted, follow up contacts are excluded. Customers are separated into groups whenever the value in the Date field changes to a new week.

The following example is applicable to Crystal syntax:

DistinctCount([1,3,5,3,2,5])

Returns 4. Counts the number of distinct values in the array. Duplicate values are ignored.

Note:    Using this function in a formula forces the formula to be evaluated at print time.

For more information on evaluation time considerations, see Evaluation Time functions.

Comments

DistinctCount counts the number of distinct values in a field. Duplicate values are ignored.



Seagate Software IMG Holdings, Inc.
http://www.seagatesoftware.com
Support services:
http://support.seagatesoftware.com